import React from "react";
import './follow.css';
import { queryFollow } from "../../services/new";
import UcCell from '../../components/uc-cell/uc-cell'
import NavHeade from "../../components/Nav_header";

export default class Follow extends React.Component {
    state = {
        follow: [],
    };

    async componentDidMount() {
        let { data: follow } = await queryFollow();
        this.setState({ follow })
    }

    render() {
        let { follow } = this.state
        return (
            <div style={{ marginTop: '.6rem' }}>
                <NavHeade />
                {
                    follow.map((item, index) =>
                        <UcCell
                            key={item._id}
                            title={item.title}
                            label={item.des}
                            index={index}
                            to={`/detail/${item._id}?collectionName=follow`}
                        />
                    )
                }
            </div>
        )
    }
}